function leaveMessage() {
    var user_name = $('#user_name').val();
    var reply_num = $('#reply_num').val();
    var content = ue.getContent();
    console.log(user_name);
    console.log(reply_num);
    console.log(content);
    // 姓名验证
    if (user_name == '' || user_name == '您的姓名') {
        jQuery.dialog.tips('<p class="tips_12_g">请填写您的姓名</p>');
        jQuery('#user_name').focus();
        return;
    }
    if(reply_num<0){
        jQuery.dialog.tips('<p class="tips_12_g">请选择出席认识</p>');
        return;
    }
    // 留言验证
    if (content.length < 5) {
        jQuery.dialog.tips('<p class="tips_12_g">留言内容不能少于5个字符</p>');
        return;
    }
    $.ajax({
        'type': 'post',
        'url': '?r=home/form/ajaxpush',
        'data': {'user_name': user_name, 'content': content, 'table': 'presence', 'reply_num': reply_num},
        'dataType': 'json', //json Obj
        success: function (json) {
            if (json.status == '1') {
                jQuery.dialog.tips('<p class="tips_12_g">' + json.msg + '</p>');
                $("#msg_area").prepend(json.html).hide().fadeIn("slow");
            } else {
                jQuery.dialog.tips('<p class="tips_12_g">' + json.msg + '</p>');
            }
        }
    });
}

/**
 * [get_wall 分页]
 * @param  {[type]} p [页码]
 * @return {[type]}   [null]
 */
function get_wall(p) {
    if (p > 0) {
        $.ajax({
            type: 'post',
            url: '?r=home/form/ajaxpage',
            data: {'page': p, 'offset': offset},
            dataType: 'json',
            success: function (json) {
                if(json.html){
                    $('#msg_area').html(json.html);
                }else{
                    jQuery.dialog.tips('<p class="tips_12_g"> 您当前的页码不存在!</p>');
                }

            }
        });
    }
}

function attend() {
    var attender = $('#attender').val();
    var attPhone = $('#attPhone').val();
    var attNum = $('#attNum').val();
    var remark = $('#remark').val();
    var muid = $("#muid").val();
    if (attender.length > 0 && attNum.length > 0) {
        $.ajax({type: 'post', url: '/member/action/attend.php', data: {attender: attender, attPhone: attPhone, attNum: attNum, remark: remark, muid: muid}, success: function (r) {
            var obj = eval('(' + r + ')');
            var result = obj.success;
            if (result) {
                alert('提交成功');
            } else {
                alert('提交失败，请重试！');
            }
        }});
    }
    ;
}
function absent() {
    var absenter = $('#absenter').val();
    var absPhone = $('#absPhone').val();
    var reason = $('#reason').val();
    var muid = $("#muid").val();
    if (absenter.length > 0) {
        $.ajax({type: 'post', url: '/member/action/absent.php', data: {absenter: absenter, absPhone: absPhone, reason: reason, muid: muid}, success: function (r) {
            var obj = eval('(' + r + ')');
            var result = obj.success;
            if (result) {
                alert('提交成功');
            } else {
                alert('提交失败，请重试！');
            }
        }});
    }
}
//$(function () {
//    var muid = $("#muid").val();
//    $.ajax({type: "post", url: "/member/action/getMsg.php", async: false, data: {"muid": muid}, success: function (data) {
//        data = "<p class=\"Blessing\">祝福留言</p>" + data;
//        $(".Leave_message").html(data);
//    }});
//});